//
// Created by 123 on 2024/12/31.
//
#include "iostream"
using namespace std;

class Person{
public:
    int age;
    int* height;
public:
    Person(){}
    Person(int ages,int heights){
        age = ages;
        height = new int(heights);
    }
    Person(const Person& p){
        age = p.age;
        height = new int(*p.height);
    }
    ~Person(){
        if(height != NULL){
            delete height;
        }
    }
};

void test(){
    Person p1(18,180);
    Person p2(p1);
    cout << "p1==" << p1.height << endl;
    cout << "p2==" << p2.height << endl;
}

int main061(){
    test();

    return 0;
}